package dto

import (
    "time"

    "go-admin/app/hunter/models"
    "go-admin/common/dto"
    common "go-admin/common/models"
)

type HtContractGetPageReq struct {
    dto.Pagination `search:"-"`
    TalentId       int    `form:"talentId"  search:"type:exact;column:talent_id;table:ht_contract" comment:"人才id"`
    BeginTime      string `form:"beginTime" search:"type:gte;column:notify_time;table:ht_contract" comment:"提醒时间"`
    EndTime        string `form:"endTime" search:"type:lte;column:notify_time;table:ht_contract" comment:"提醒时间"`
    Note           string `form:"note"  search:"type:exact;column:note;table:ht_contract" comment:"备注信息"`
    HtContractOrder
}

type HtContractOrder struct {
    Id         string `form:"idOrder"  search:"type:order;column:id;table:ht_contract"`
    TalentId   int    `form:"talentIdOrder"  search:"type:order;column:talent_id;table:ht_contract"`
    NotifyTime string `form:"notifyTimeOrder"  search:"type:order;column:notify_time;table:ht_contract"`
    Note       string `form:"noteOrder"  search:"type:order;column:note;table:ht_contract"`
    CreateBy   string `form:"createByOrder"  search:"type:order;column:create_by;table:ht_contract"`
    UpdateBy   string `form:"updateByOrder"  search:"type:order;column:update_by;table:ht_contract"`
    CreatedAt  string `form:"createdAtOrder"  search:"type:order;column:created_at;table:ht_contract"`
    UpdatedAt  string `form:"updatedAtOrder"  search:"type:order;column:updated_at;table:ht_contract"`
    DeletedAt  string `form:"deletedAtOrder"  search:"type:order;column:deleted_at;table:ht_contract"`
}

func (m *HtContractGetPageReq) GetNeedSearch() interface{} {
    return *m
}

type HtContractInsertReq struct {
    Id         int        `json:"-" comment:"id"` // id
    TalentId   int        `json:"talentId" comment:"人才id"`
    NotifyTime *time.Time `json:"notifyTime" comment:"提醒时间"`
    Note       string     `json:"note" comment:"备注信息"`
    common.ControlBy
}

func (s *HtContractInsertReq) Generate(model *models.HtContract) {
    if s.Id == 0 {
        model.Model = common.Model{Id: s.Id}
    }
    model.TalentId = s.TalentId
    model.NotifyTime = s.NotifyTime
    model.Note = s.Note
    model.CreateBy = s.CreateBy // 添加这而，需要记录是被谁创建的
}

func (s *HtContractInsertReq) GetId() interface{} {
    return s.Id
}

type HtContractUpdateReq struct {
    Id         int        `uri:"id" comment:"id"` // id
    TalentId   int        `json:"talentId" comment:"人才id"`
    NotifyTime *time.Time `json:"notifyTime" comment:"提醒时间"`
    Note       string     `json:"note" comment:"备注信息"`
    common.ControlBy
}

func (s *HtContractUpdateReq) Generate(model *models.HtContract) {
    if s.Id == 0 {
        model.Model = common.Model{Id: s.Id}
    }
    model.TalentId = s.TalentId
    model.NotifyTime = s.NotifyTime
    model.Note = s.Note
    model.UpdateBy = s.UpdateBy // 添加这而，需要记录是被谁更新的
}

func (s *HtContractUpdateReq) GetId() interface{} {
    return s.Id
}

// HtContractGetReq 功能获取请求参数
type HtContractGetReq struct {
    Id int `uri:"id"`
}

func (s *HtContractGetReq) GetId() interface{} {
    return s.Id
}

// HtContractDeleteReq 功能删除请求参数
type HtContractDeleteReq struct {
    Ids []int `json:"ids"`
}

func (s *HtContractDeleteReq) GetId() interface{} {
    return s.Ids
}
